package ru.susu.algebra.centralunits.exponent;

import java.io.PrintStream;
import java.math.BigInteger;

import org.apache.log4j.BasicConfigurator;

import ru.susu.algebra.chartable.constructor.AlternatingCharTableUtil;
import ru.susu.algebra.io.FileUtilities;
import ru.susu.algebra.partition.Partition;

/**
 * @author akargapolov
 * @since 20.07.2012
 */
public class ExponentsPrinter
{
	private static final String FILENAME = "results/exps/exps.txt";
	private static int MAX_NUMBER = 70;

	public static void main(String[] args) throws Exception
	{
		BasicConfigurator.configure();
		PrintStream stream = FileUtilities.createBufferedFilePrintStream(FILENAME);
		for (int number = 1; number <= MAX_NUMBER; ++number)
		{
			for (Partition partition : AlternatingCharTableUtil.listSpecialRowsNotIntegerCharacter(number))
			{
				BigInteger k = ExponentUtils.evaluateK(partition);
				BigInteger exp = ExponentUtils.getExponent(partition);
				stream.println(number + ";" + k + ";" + exp);
				System.out.println(number + ";" + k + ";" + exp);
			}
			stream.flush();
		}
		stream.close();
	}
}
